import Cookies from 'js-cookie'

const TokenKey = 'tokenef'
const UserInfoKey = 'fk_userInfo'
const DepInfoKey = 'fk_depInfo'

export function getToken() {
  return sessionStorage.getItem(TokenKey)
}

export function setToken(token) {
  return sessionStorage.setItem(TokenKey, token)
}

export function removeToken() {
  return sessionStorage.removeItem(TokenKey)
}
export function getUserInfo() {
  return JSON.parse(sessionStorage.getItem(UserInfoKey))
}

export function setUserInfo(userInfo) {
  return sessionStorage.setItem(UserInfoKey, JSON.stringify(userInfo))
}

export function removeUserInfo() {
  return sessionStorage.removeItem(UserInfoKey)
}

export function getDepInfo() {
  return JSON.parse(sessionStorage.getItem(DepInfoKey))
}

export function setDepInfo(userInfo) {
  return sessionStorage.setItem(DepInfoKey, JSON.stringify(userInfo))
}

export function removeDepInfo() {
  return sessionStorage.removeItem(DepInfoKey)
}
